package com.health.circle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.circle.mapper.DepartmentMapper;
import com.health.circle.service.DepartmentService;
import com.health.common.core.po.DepartmentPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @BelongsProject: dimensionality-manage
 * @BelongsPackage: com.health.circle.service.impl
 * @Author: 许力匀
 * @CreateTime: 2024-12-16  19:18
 * @Description: 科室业务层实现
 * @Version: 1.0
 */
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, DepartmentPo> implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<DepartmentPo> getDepartment(Integer id) {

        LambdaQueryWrapper<DepartmentPo> departmentPoLambdaQueryWrapper = new LambdaQueryWrapper<>();

        departmentPoLambdaQueryWrapper.eq(id!=null && id !=0,DepartmentPo::getId,id);

       return departmentMapper.selectList(departmentPoLambdaQueryWrapper);

    }
}
